package com.bwie.controller;

import com.bwie.pojo.TbShop;
import com.bwie.service.TbShopService;
import com.bwie.utils.R;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author : Yoo19
 * @description :
 * @createDate : 2025/7/15 11:55 55
 */
@RestController
@RequestMapping("/user/shop")
public class ShopController {
    @Autowired
    private TbShopService tbShopService;

    /**
     * 列表
     * @return
     */
    @ApiOperation("列表")
    @PostMapping("/getShopList")
    public R getShopList(){
        return tbShopService.getShopList();
    }

    /**
     * 详情
     * @param shopId
     * @return
     */
    @ApiOperation("店铺详情")
    @PostMapping("/getDetailList/{shopId}")
    public R getDetailList(@PathVariable("shopId")Integer shopId){
        return tbShopService.getDetailList(shopId);
    }

    /**
     * 新增店铺
     * @param tbShop
     * @return
     */
    @ApiOperation("新增店铺")
    @PostMapping("/addShop")
    public R addShop(@RequestBody TbShop tbShop){
        return tbShopService.addShop(tbShop);
    }

    /**
     * 修改店铺信息
     * @param tbShop
     * @return
     */
    @ApiOperation("修改店铺")
    @PostMapping("/updateShop")
    public R updateShop(@RequestBody TbShop tbShop){
        return tbShopService.updateShop(tbShop);
    }

    /**
     * 删除店铺
     * @param shopId
     * @return
     */
    @ApiOperation("删除店铺")
    @PostMapping("/deleteShop/{shopId}")
    public R deleteShop(@PathVariable("shopId")Integer shopId){
        return tbShopService.deleteShop(shopId);
    }

}
